<?xml version="1.0" encoding="utf-8"?>
<component>
    <?component error="false" debug="false"?>
    <registration description="md5" progid="component.md5" version="1.00" classid="{d6997159-1149-4efd-83e7-704810898aa9}" />
    <public>
        <property name="version" />
        <method name="encrypt">
            <parameter name="string" />
            <parameter name="capital" />
        </method>
    </public>
    <implements type="ASP" id="ASP"/>
    <script language="JScript" runat="server">
    <![CDATA[
        var version = '1.00';
        
        var _capital = false;
        var _chrsz   = 8;

        function _core(binary, length) {
            binary[length >> 5] |= 0x80 << ((length) % 32);
            binary[(((length + 64) >>> 9) << 4) + 14] = length;
          
            var _a = 1732584193;
            var _b = -271733879;
            var _c = -1732584194;
            var _d = 271733878;

            for(var _index = 0; _index < binary.length; _index += 16) {
                var _olda = _a;
                var _oldb = _b;
                var _oldc = _c;
                var _oldd = _d;

                _a = _ff(_a, _b, _c, _d, binary[_index + 0], 7, -680876936);
                _d = _ff(_d, _a, _b, _c, binary[_index + 1], 12, -389564586);
                _c = _ff(_c, _d, _a, _b, binary[_index + 2], 17, 606105819);
                _b = _ff(_b, _c, _d, _a, binary[_index + 3], 22, -1044525330);
                _a = _ff(_a, _b, _c, _d, binary[_index + 4], 7, -176418897);
                _d = _ff(_d, _a, _b, _c, binary[_index + 5], 12, 1200080426);
                _c = _ff(_c, _d, _a, _b, binary[_index + 6], 17, -1473231341);
                _b = _ff(_b, _c, _d, _a, binary[_index + 7], 22, -45705983);
                _a = _ff(_a, _b, _c, _d, binary[_index + 8], 7, 1770035416);
                _d = _ff(_d, _a, _b, _c, binary[_index + 9], 12, -1958414417);
                _c = _ff(_c, _d, _a, _b, binary[_index + 10], 17, -42063);
                _b = _ff(_b, _c, _d, _a, binary[_index + 11], 22, -1990404162);
                _a = _ff(_a, _b, _c, _d, binary[_index + 12], 7, 1804603682);
                _d = _ff(_d, _a, _b, _c, binary[_index + 13], 12, -40341101);
                _c = _ff(_c, _d, _a, _b, binary[_index + 14], 17, -1502002290);
                _b = _ff(_b, _c, _d, _a, binary[_index + 15], 22, 1236535329);

                _a = _gg(_a, _b, _c, _d, binary[_index + 1], 5, -165796510);
                _d = _gg(_d, _a, _b, _c, binary[_index + 6], 9, -1069501632);
                _c = _gg(_c, _d, _a, _b, binary[_index + 11], 14, 643717713);
                _b = _gg(_b, _c, _d, _a, binary[_index + 0], 20, -373897302);
                _a = _gg(_a, _b, _c, _d, binary[_index + 5], 5, -701558691);
                _d = _gg(_d, _a, _b, _c, binary[_index + 10], 9, 38016083);
                _c = _gg(_c, _d, _a, _b, binary[_index + 15], 14, -660478335);
                _b = _gg(_b, _c, _d, _a, binary[_index + 4], 20, -405537848);
                _a = _gg(_a, _b, _c, _d, binary[_index + 9], 5, 568446438);
                _d = _gg(_d, _a, _b, _c, binary[_index + 14], 9, -1019803690);
                _c = _gg(_c, _d, _a, _b, binary[_index + 3], 14, -187363961);
                _b = _gg(_b, _c, _d, _a, binary[_index + 8], 20, 1163531501);
                _a = _gg(_a, _b, _c, _d, binary[_index + 13], 5, -1444681467);
                _d = _gg(_d, _a, _b, _c, binary[_index + 2], 9, -51403784);
                _c = _gg(_c, _d, _a, _b, binary[_index + 7], 14, 1735328473);
                _b = _gg(_b, _c, _d, _a, binary[_index + 12], 20, -1926607734);

                _a = _hh(_a, _b, _c, _d, binary[_index + 5], 4, -378558);
                _d = _hh(_d, _a, _b, _c, binary[_index + 8], 11, -2022574463);
                _c = _hh(_c, _d, _a, _b, binary[_index + 11], 16, 1839030562);
                _b = _hh(_b, _c, _d, _a, binary[_index + 14], 23, -35309556);
                _a = _hh(_a, _b, _c, _d, binary[_index + 1], 4, -1530992060);
                _d = _hh(_d, _a, _b, _c, binary[_index + 4], 11, 1272893353);
                _c = _hh(_c, _d, _a, _b, binary[_index + 7], 16, -155497632);
                _b = _hh(_b, _c, _d, _a, binary[_index + 10], 23, -1094730640);
                _a = _hh(_a, _b, _c, _d, binary[_index + 13], 4, 681279174);
                _d = _hh(_d, _a, _b, _c, binary[_index + 0], 11, -358537222);
                _c = _hh(_c, _d, _a, _b, binary[_index + 3], 16, -722521979);
                _b = _hh(_b, _c, _d, _a, binary[_index + 6], 23, 76029189);
                _a = _hh(_a, _b, _c, _d, binary[_index + 9], 4, -640364487);
                _d = _hh(_d, _a, _b, _c, binary[_index + 12], 11, -421815835);
                _c = _hh(_c, _d, _a, _b, binary[_index + 15], 16, 530742520);
                _b = _hh(_b, _c, _d, _a, binary[_index + 2], 23, -995338651);

                _a = _ii(_a, _b, _c, _d, binary[_index + 0], 6, -198630844);
                _d = _ii(_d, _a, _b, _c, binary[_index + 7], 10, 1126891415);
                _c = _ii(_c, _d, _a, _b, binary[_index + 14], 15, -1416354905);
                _b = _ii(_b, _c, _d, _a, binary[_index + 5], 21, -57434055);
                _a = _ii(_a, _b, _c, _d, binary[_index + 12], 6, 1700485571);
                _d = _ii(_d, _a, _b, _c, binary[_index + 3], 10, -1894986606);
                _c = _ii(_c, _d, _a, _b, binary[_index + 10], 15, -1051523);
                _b = _ii(_b, _c, _d, _a, binary[_index + 1], 21, -2054922799);
                _a = _ii(_a, _b, _c, _d, binary[_index + 8], 6, 1873313359);
                _d = _ii(_d, _a, _b, _c, binary[_index + 15], 10, -30611744);
                _c = _ii(_c, _d, _a, _b, binary[_index + 6], 15, -1560198380);
                _b = _ii(_b, _c, _d, _a, binary[_index + 13], 21, 1309151649);
                _a = _ii(_a, _b, _c, _d, binary[_index + 4], 6, -145523070);
                _d = _ii(_d, _a, _b, _c, binary[_index + 11], 10, -1120210379);
                _c = _ii(_c, _d, _a, _b, binary[_index + 2], 15, 718787259);
                _b = _ii(_b, _c, _d, _a, binary[_index + 9], 21, -343485551);

                _a = _add(_a, _olda);
                _b = _add(_b, _oldb);
                _c = _add(_c, _oldc);
                _d = _add(_d, _oldd);
            }
            return Array(_a, _b, _c, _d);
        }
        
        function _add(x, y) {
            var lsw = (x & 0xFFFF) + (y & 0xFFFF);
            var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
            return (msw << 16) | (lsw & 0xFFFF);
        }

        function _roll(num, cnt) {
            return (num << cnt) | (num >>> (32 - cnt));
        }

        function _cmn(q, a, b, x, s, t) {
            return _add(_roll(_add(_add(a, q), _add(x, t)), s),b);
        }
        
        function _ff(a, b, c, d, x, s, t) {
            return _cmn((b & c) | ((~b) & d), a, b, x, s, t);
        }
        
        function _gg(a, b, c, d, x, s, t) {
            return _cmn((b & d) | (c & (~d)), a, b, x, s, t);
        }
        
        function _hh(a, b, c, d, x, s, t) {
            return _cmn(b ^ c ^ d, a, b, x, s, t);
        }
        
        function _ii(a, b, c, d, x, s, t) {
            return _cmn(c ^ (b | (~d)), a, b, x, s, t);
        }

        function _str2bin(string) {
            var _bin = Array();
            var _mask = (1 << _chrsz) - 1;
            for(var _index = 0; _index < string.length * _chrsz; _index += _chrsz)
                _bin[_index>>5] |= (string.charCodeAt(_index / _chrsz) & _mask) << (_index % 32);
            return _bin;
        }

        function _bin2hex(binary) {
            var _hex = _capital ? '0123456789ABCDEF' : '0123456789abcdef';
            var _string = '';
            for(var _index = 0; _index < binary.length * 4; _index++) {
                _string += _hex.charAt((binary[_index >> 2] >> ((_index % 4) * 8 + 4)) & 0xF) + _hex.charAt((binary[_index >> 2] >> ((_index % 4) * 8)) & 0xF);
            }
            return _string;
        }
        
        function encrypt(string, capital) {
            _capital = capital;
            return _bin2hex(_core(_str2bin(string), string.length * _chrsz));
        }
    ]]>
    </script>
</component>
